package actor;

import view.ActorView;

public class Monster extends Actor {
    private final double ATTACK_SUCCESS = 0.8;

    public Monster(String name, int speed, int power, int life, ElementType type, String image) {
        super(name, speed, power, life, image, type);
    }

    @Override
    public int attack(ActorView actor) {
        double rand = Math.random();
        if (rand < ATTACK_SUCCESS) {
            actor.beingAttack(getPower());
            return getPower();
        }
        return -1;
    }
}
